/**
 * GET
 * 参数 - URL上
 * 返回 - String
 */
let dataLinkGetJson = (url, callback, err) => {
	wx.request({
		url: url,
		method: GET,
		header: {
			"Content-Type": "application/x-www-form-urlencoded" // 默认值
		},
		success: function (res) {
			callback(res);
		},
		fail: function (err) {
			console.log(url + err);
		},
		complete: function (res) {
			//console.log(url+res);
		}
	})
}

/**
 * POST
 * 参数 - URL上
 * 返回 - String
 */
let dataLinkPostJson = (url, params, callback, err) => {
	wx.request({
		url: url,
		method: "POST",
		header: {
			"Content-Type": "application/x-www-form-urlencoded"
		},
		data: params,
		success: function (res) {
			callback(res.data);
		},
		fail: function (err) {
			//console.log(url+err);
		},
		complete: function (res) {
			//console.log(url+res);
		}
	})
}




module.exports = {
	dataLinkGetJson: dataLinkGetJson,
	dataLinkPostJson: dataLinkPostJson,
}